<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/7/14
 * Time: 19:34
 */

namespace app\api\model;

class Banner extends BaseModel
{
    protected $hidden = ['delete_time'];
    //关联banner_item表
    public function item()
    {
        return $this -> hasMany('BannerItem', 'banner_id', 'id');
    }
    public static function getMessageById($id)
    {
       return self::with(['item', 'item.img']) -> find();
    }
}